﻿using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Linq.Expressions;

using LeanEngine.Entity;
using LeanEngine.Data.Linq.Language;

namespace LeanEngine.Data.Linq
{
    internal sealed class QueryContext
    {
        public QueryContext()
        {
            this.QueryableTableList = new List<TableToken>();
        }

        public Expression LinqExpression { get; set; }
        public MethodCallExpression CurrentMethodCall { get; set; }
        public List<TableToken> QueryableTableList { get; private set; }

        public TableToken AddTable(MetaTable metadata)
        {
            var table = new TableToken(metadata);
            this.QueryableTableList.Add(table);

            return table;
        }
    }
}
